<?php
class MemberAction extends BaseAction {
	
	function index(){
		
		$user = d("user_view");
		$this->assign('mem_arr',$user->findall());	
		$this->display("Member:user_list");
	}
	
	function user_edit(){
		if($_POST['edit_btn']){
			$uid = $_POST['acc_id'];
			$user['pwd']=md5($_POST['pwd1']);
			$user['email']=$_POST['email'];
			$user['province']=$_POST['pro_name'];
			$user['city']=$_POST['city_name'];
			//print_r($user);
			if(d('member_info')->where("uid = $uid")->save($user)){
				$this->ajaxReturn(__APP__."/member","修改成功",1);
			}
		}
		else{
			if($_GET['uid']){
				
				$this->assign('pro_arr',d("province")->findall());	
				$this->assign('city_arr',d("city")->findall());	
				$this->assign('mem_arr',d("user_view")->where('uid = '.$_GET['uid'])->find());	
				
				$this->display("Member:user_edit");
			}
		}
	}
	
}




?>